<?php

namespace app\model;

use think\Model;

class Lang extends Model
{
    protected $connection = 'mysql';

    protected $pk = 'id';

    protected $name = 'lang';

    public static function getLang()
    {
        return self::where(['weid' => weid(), 'status' => 1])->order('sort asc,id asc')->select()->toArray();
    }
    public static function getzhLang()
    {
        return self::where(['weid' => weid(), 'locale' => 'zh', 'status' => 1])->order('sort asc,id asc')->select()->toArray();
    }

    public static function datainitial()
    {
        $weid = weid();
        $data = [
            [
                'weid' => $weid,
                'item' => 'teacherjoin',
                'title' => '师傅加盟',
                'shuoming' => '师傅加盟',
                'sort' => 100,
                'status' => 1,
            ],
            [
                'weid' => $weid,
                'item' => 'teachercertification',
                'title' => '证件',
                'shuoming' => '证件',
                'sort' => 100,
                'status' => 1,
            ]
        ];

        $mod = new self;
        $mod->saveAll($data);
    }
}
